package domain;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class Orders {
    private String id;//
    private String orderNum;//订单号
    private Date orderTime;//下单时间
    private String orderTimeStr;//字符型的下单时间
    private int peopleCount;//旅客人数
    private String orderDesc;//订单详情
    private Integer payType;//支付类型 0:支付宝  1：微信 2：其他
    private String payTypeStr;
    private int orderStatus;//订单状态  0:未支付  1：已支付
    private String orderStatusStr;

    private Product product;//产品对象
    private Member member;//会员对象
    private List<Traveller> travellers;//旅客集合

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public Date getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Date orderTime) {
        this.orderTime = orderTime;
    }

    public String getOrderTimeStr() {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return orderTime == null?"":df.format(orderTime);
    }

    public void setOrderTimeStr(String orderTimeStr) {
        this.orderTimeStr = orderTimeStr;
    }

    public int getPeopleCount() {
        return peopleCount;
    }

    public void setPeopleCount(int peopleCount) {
        this.peopleCount = peopleCount;
    }

    public String getOrderDesc() {
        return orderDesc;
    }

    public void setOrderDesc(String orderDesc) {
        this.orderDesc = orderDesc;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public String getPayTypeStr() {
        switch (payType){
            case 0:return "支付宝";
            case 1:return "微信";
            case 2:return "其他";
        }
        return "";
    }

    public void setPayTypeStr(String payTypeStr) {
        this.payTypeStr = payTypeStr;
    }

    public int getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(int orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getOrderStatusStr() {
       switch (orderStatus){
           case 0:return "未支付";
           case 1:return "已支付";
       }
       return "";
    }

    public void setOrderStatusStr(String orderStatusStr) {
        this.orderStatusStr = orderStatusStr;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public Member getMember() {
        return member;
    }

    public void setMember(Member member) {
        this.member = member;
    }

    public List<Traveller> getTravellers() {
        return travellers;
    }

    public void setTravellers(List<Traveller> travellers) {
        this.travellers = travellers;
    }
}
